import Vue from 'vue'
import Vuex from 'vuex'
import persisted from 'vuex-persistedstate'

Vue.use(Vuex)
Vue.use(persisted)

export default new Vuex.Store({
  state: {
    user:{},
    showLogin:false
  },
  mutations: {
    userChange(state,obj){
      state.user=obj
      if(obj.type=='del'){
        state.user=[]
      }
    },
    showLoginChange(state,v){
      state.showLogin=v
    }
  },
  actions: {
  },
  modules: {
  },
  plugins:[persisted()]
})
